package model;
import java.util.ArrayList;

public class City extends Card{
	ArrayList<City> cityDeck; //the deck of all city's cards
	String owner ="Bank";//the owner of the card which is by default the Bank
	public String family; //it means the family group like station or red
	public int price,mortgage, house_cost,rent,pw1h,pw2h,pw3h,pw4h,pw5h;//rent = price without houses. pw1h=price with 1 house....pw5h=price with 1 hotel (5 houses)
	boolean isMortgage;
	
	//constructor empty
	public City() {
	}
	
	//constructor of a station card or a utility card
	public City(String name,String family, int mortgage){
		this.name=name;
		this.family=family;
		this.mortgage=mortgage;
		isMortgage=false;
	}
	
	//constructor of a city card
	public City(String name,String family,int rent, int pw1h, int pw2h, int pw3h,int pw4h,int pw5h, int mortgage, int house_cost){
		this.name=name;
		this.family=family;
		this.rent=rent;
		this.pw1h=pw1h;
		this.pw2h=pw2h;
		this.pw3h=pw3h;
		this.pw4h=pw4h;
		this.pw5h=pw5h;
		this.mortgage=mortgage;
		this.house_cost=house_cost;
		isMortgage=false;
	}
	
	//build the city's deck
	public ArrayList<City> build_deck(){
		cityDeck = new ArrayList<City>();
		City c1 = new City("Botanic Gardens","pink",2, 10, 30, 90, 160, 250, 50, 30);//city card
		cityDeck.add(c1);
		City c2 = new City("Queens Park","pink",4,20,60,180,260,450,50,30);
		cityDeck.add(c2);
		City c3 = new City("Glasgow Central","station",100);//station card
		cityDeck.add(c3);
		City c4 = new City("Richmond Street","cyan",6,30,90,270,400,550,50,50);
		cityDeck.add(c4);
		City c5 = new City("Argyle Street","cyan",6,30,90,270,400,550,50,50);
		cityDeck.add(c5);
		City c6 = new City("Hope Street","cyan",8,40,100,300,450,600,60,50);
		cityDeck.add(c6);
		City c7 = new City("Celtic Park","magenta",10,50,150,450,625,750,70,100);
		cityDeck.add(c7);
		City c8 = new City("Electric Company","utility", 75);//utility card
		cityDeck.add(c8);
		City c9 = new City("Kelvin Hall","magenta",10,50,150,450,625,750,70,100);
		cityDeck.add(c9);
		City c10 = new City("Hampden Park","magenta",12,60,180,500,700,900,80,100);
		cityDeck.add(c10);
		City c11 = new City("Glasgow Airport","station",100);
		cityDeck.add(c11);
		City c12 = new City("Buchanan Street","orange",14,70,200,550,750,950,90,100);
		cityDeck.add(c12);
		City c13 = new City("Byres Road","orange",14,70,200,550,750,950,90,100);
		cityDeck.add(c13);
		City c14 = new City("Howard Street","orange",16,80,220,600,800,1000,100,100);
		cityDeck.add(c14);
		City c15 = new City("Cowcaddens Road","red",18,90,250,700,875,1050,110,150);
		cityDeck.add(c15);
		City c16 = new City("Dobbie's Loan","red",18,90,250,700,875,1050,110,150);
		cityDeck.add(c16);
		City c17 = new City("Glasgow Cal. Univ.","red",20,100,300,750,925,1100,120,150);
		cityDeck.add(c17);
		City c18 = new City("Queen Street Station","station",100);
		cityDeck.add(c18);
		City c19 = new City("Bath Street","yellow",22,110,330,800,975,1150,130,150);
		cityDeck.add(c19);
		City c20 = new City("Ingraam Street","yellow",22,110,330,800,975,1150,130,150);
		cityDeck.add(c20);
		City c21 = new City("Water Works","utility",75);
		cityDeck.add(c21);
		City c22 = new City("Saint Vincent Street","yellow",24,120,360,850,1025,1200,140,150);
		cityDeck.add(c22);
		City c23 = new City("West Regent Street","green",26,130,390,900,1100,1275,150,200);
		cityDeck.add(c23);
		City c24 = new City("Sauchiehall Street","green",26,130,390,900,1100,1275,150,200);
		cityDeck.add(c24);
		City c25 = new City("Bothwell Street","green",28,150,450,1000,1200,1400,160,200);
		cityDeck.add(c25);
		City c26 = new City("Buchanan Bus Station","station",100);
		cityDeck.add(c26);
		City c27 = new City("Georges Square","blue",35,175,500,1100,1300,1500,175,200);
		cityDeck.add(c27);
		City c28 = new City("Pollok Country Park","blue",50,200,600,1400,1700,2000,200,200);
		cityDeck.add(c28);
		
		return cityDeck;
		
	}
	
	//return the rent of the city
	public int getRent(){
		return rent;
	}
	//set a city on Mortgage
	public void setMortgage(){
		this.isMortgage=true;
	}
	
	//remove the mortgage on a city
	public void removeMortgage(){
		this.isMortgage=false;
	}
	
	//return an arrayList of the family of a card/place
	public ArrayList<City> getFamily(String s){
		ArrayList<City>family=new ArrayList<>();
		for(int i =0;i<deckCity.size();i++){
			if(deckCity.get(i).family.equals(s)){
				family.add(deckCity.get(i));
			}
			
		}
		return family;
	}
}
